package com.example.chapter4.aspect.service.impl;

import com.example.chapter4.pojo.User;
import com.example.chapter4.aspect.service.UserService;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    private User user = null;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @Override
    public void printUser(User user) {
        if (user == null){
            throw new RuntimeException("检查用户参数是否为空． ．． ．．．");
        }
        System.out.println("id = " + user.getId());
        System.out.println("username = " + user.getUsername());
        System.out.println("note = " + user.getNote());

    }
}
